:root {
  // Note: Custom variable values only support SassScript inside `#{}`.
  // TODO migrate SCSS variables to CSS variables

  interpolate-size: allow-keywords;

  #{$rootPrefix}global-font-color: #{$global-font-color};
  #{$rootPrefix}global-border-color: #{$global-border-color};

  // Theme colors variables
  @each $color, $value in $theme-colors {
    #{$rootPrefix}#{$color}: #{$value};
  }

  // Scroll margin top and Stack sticky top related
  #{$rootPrefix}scroll-mt: calc(#{$header-height} + #{$global-scroll-margin-top});

  // Set breadcrumb height to 0px if breadcrumb is disabled
  #{$rootPrefix}breadcrumb-height: 0px;

  // hr / divider style
  #{$rootPrefix}hr-background-color: #{darken($global-border-color, 5%)};
  #{$rootPrefix}hr-before-color: #{lighten($single-link-hover-color, 4%)};
  #{$rootPrefix}divider-edge-weak: linear-gradient(to right, transparent, var(#{$rootPrefix}divider-bg, #d0d0d5), transparent);

  // Scrollbar related variables
  #{$rootPrefix}scrollbar-thumb-color: #{$scrollbar-color};
  #{$rootPrefix}scrollbar-thumb-hover-color: #{$scrollbar-hover-color};
  #{$rootPrefix}scrollbar-track-color: transparent;
  #{$rootPrefix}scrollbar-width: thin;
  #{$rootPrefix}scrollbar-width-legacy: 12px;

  #{$rootPrefix}code-inline-background-color: rgba(175, 184, 193, 0.2);
}

// Dark theme
[data-theme=dark] {
  #{$rootPrefix}global-font-color: #{$global-font-color-dark};
  #{$rootPrefix}global-border-color: #{$global-border-color-dark};

  @each $color, $value in $theme-colors {
    #{$rootPrefix}#{$color}: #{darken($value, 5%)};
  }

  #{$rootPrefix}hr-background-color: #{lighten($global-border-color-dark, 5%)};
  #{$rootPrefix}hr-before-color: #{darken($global-link-hover-color-dark, 4%)};

  #{$rootPrefix}code-inline-background-color: rgba(99, 110, 123, 0.4);
}
